package com.it.base.thread.pool.newSingleThreadExecutorDemo.Task;

import java.util.ArrayList;
import java.util.List;

public class XxxService extends Thread{
    // 定义要处理的数据集合
    private List<Integer> list = new ArrayList<>();

    public XxxService(List<Integer> list) {
        this.list = list;
    }

    @Override
    public void run() {

        for (Integer integer:list){
            // 这里是数据处理
            System.out.println("当前线程id为："+Thread.currentThread().getId()+",当前处理的数据条数是："+integer);
        }
    }
}
